/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mamayukero.problem.environment.component;

public class Machine {
    public int type,            //tipe mesin
                maxTime,        //lama penggunaan maksimum dalam satu hari
                maxPeriod,      //lama penggunaan terus menerus maksimum
                restTime,       //waktu istirahat jika mencapai terus menerus
                productiv,      //produktfitas
                inputAmount,    //jumlah dependensi
                overloadEffect, //effect overload
                rentPrice,      //biaya sewa
                dependant;      //dependensi mesin
    
    public boolean isActive;
    
    public Machine(int type, int maxTime, int maxPeriod, int restTime, int productiv, int inputAmount, int overloadEffect, int rentPrice, int dependant) {
        this.type = type;
        this.maxTime = maxTime;
        this.maxPeriod = maxPeriod;
        this.restTime = restTime;
        this.productiv = productiv;
        this.inputAmount = inputAmount;
        this.overloadEffect = overloadEffect;
        this.rentPrice = rentPrice;
        this.dependant = dependant;
        isActive = false;
    }
    
    public Machine(Machine m) {
        this.type = m.type;
        this.maxTime = m.maxTime;
        this.maxPeriod = m.maxPeriod;
        this.restTime = m.restTime;
        this.productiv = m.productiv;
        this.inputAmount = m.inputAmount;
        this.overloadEffect = m.overloadEffect;
        this.rentPrice = m.rentPrice;
        this.dependant = m.dependant;
        isActive = false;
    }
    
    public void Activate() {
        isActive = true;
    }
    
    public void Deactivate() {
        isActive = false;
    }
    
    
    @Override
    public String toString() {
            return "[M] (" + "[" + type + "]" + 
                    ", T=" + maxTime + 
                    ", W=" + maxPeriod + 
                    ", S=" + restTime + 
                    ", P=" + productiv + 
                    ", I=" + inputAmount + 
                    "[" + dependant + "]" +
                    ", C=" + overloadEffect + 
                    ", R=" + rentPrice + ") Active = " +
                    isActive;
    }
                
}
